import {AdminType} from "../type/adminType";
import {Dispatch} from "redux";

export interface IAdminAction {
    /**
     * 每个action包括
     * type：
     * text：内容
     */
    type: AdminType,
    data?: any
}

/**
 * 登录的时候实现登录的action
 * @param dispatch
 * @param admin
 */
export const doLogin = (dispatch: Dispatch, admin: any) =>{
    dispatch({type: AdminType.LOGIN, data:{admin, loading: false}})
}
